﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace weighing
{
    public class BillCalculateVisblityConverter : System.Windows.Data.IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            WeightingBillType param = (WeightingBillType)parameter;           
            if(param == WeightingBillType.Buy)
            {
                return App.Config.BillPrintConfig.InShowCalculate ? Visibility.Visible : Visibility.Collapsed;
            }
            else if(param == WeightingBillType.Sale)
            {
                return App.Config.BillPrintConfig.OutShowCalculate ? Visibility.Visible : Visibility.Collapsed;
            }
            else
            {
                return Visibility.Collapsed;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
